package map;

import java.util.HashMap;
import java.util.Map;

public class MapDemo2 {
	public static void main(String[] args) {
		Map<String,Integer> map = new HashMap<>();
		map.put("语文",99);
		map.put("数学",100);
		map.put("英语",88);
		map.put("物理",96);
		map.put("化学",99);
		System.out.println(map);
		
		Integer value = map.get("语文");
		System.out.println(value);
		value = map.get("体育");
		System.out.println(value);
		System.out.println("map大小为："+map.size());
		System.out.println("map是否是空集："+map.isEmpty());
		System.out.println("map是否包含数字这个键："+map.containsKey("数字"));
		System.out.println("map是否剖包含95这个值："+map.containsKey(95));
		
		map.remove("数字");
		System.out.println(map);
		value = map.remove("物理");
		System.out.println(value);
		System.out.println(map);
		
		map.clear();
		System.out.println(map);
	}
}














